package com.example.webbasic.coprop;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;

import lombok.Data;

/**
 * 配置类
 * @author ben
 * @date 2021-11-13 22:05:00 CST
 */
@Data
@Configuration
// 试验1
//@ConditionalOnProperty(value = {"coprop.value"}, havingValue = "abc")
// 试验2
//@ConditionalOnProperty(prefix = "coprop", name = {"value", "other"})
//试验3 失败 无论是否有两个配置，都会生成配置
//@ConditionalOnProperty(prefix = "coprop", name = {"value", "other"}, matchIfMissing = true)
//@ConditionalOnProperty(prefix = "coprop", name = {"value"}, matchIfMissing = true)
@ConditionalOnProperty(prefix = "coprop", name = "value", matchIfMissing = true)
public class CopropTestConfig {

	private String f1 = "f1 in CopropTestConfig";
	
}
